<template>
  <div>
    <el-dialog
      :title="title"
      :visible="dialogVisible"
      :show-close="false"
      width="1000px"
    >
      <manage-info :row="row" />
      <div>
        <el-row type="flex" justify="space-between" style="margin-top: 25px">
          <el-col class="manage-dialog-title">发车状况</el-col>
        </el-row>
        <el-form
          ref="manageDialog"
          :model="form"
          label-width="100px"
        >
          <el-row>
            <el-col :span="9">
              <el-form-item label="当前里程:" prop="mileage">
                <el-input
                  v-model="form.mileage"
                  size="medium"
                  placeholder="请输入当前里程"
                />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row />
          <el-row />
        </el-form>
      </div>
      <span slot="footer">
        <el-button
          @click="handleCancel"
        >
          取 消
        </el-button>
        <el-button
          type="primary"
          @click="handleConfirm"
        >
          确 定
        </el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import ManageInfo from '@/components/ManageInfo'
export default {
  name: 'ManageDialog',
  components: {
    ManageInfo
  },
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    row: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      title: '',
      form: {
        mileage: ''
      }
    }
  },
  methods: {
    handleCancel() {
      this.$emit('cancel-dialog')
      // this.$refs.orderDialog.resetFields()
    },
    handleConfirm() {
      this.$emit('confirm-dialog')
      // this.$refs.orderDialog.validate((valid) => {
      //   if (valid) {
      //     this.$emit('confirm-dialog', {
      //       id: this.row.id,
      //       picktime: this.row.picktime,
      //       returntime: this.row.returntime,
      //       pickaddress: this.row.pickaddress,
      //       returnaddress: this.row.returnaddress,
      //       delivery: this.row.delivery,
      //       method: this.row.method,
      //       cost: this.row.cost,
      //       deposit: this.row.deposit,
      //       sumcost: this.row.sumcost,
      //       brand: this.row.brand,
      //       cid: this.row.cid,
      //       number: this.row.number,
      //       ctype: this.row.ctype,
      //       color: this.row.color,
      //       pid: this.row.pid,
      //       name: this.row.name,
      //       document: this.row.document,
      //       dnumber: this.row.dnumber,
      //       tel: this.row.tel
      //     })
      //   } else {
      //     console.log('验证出错!!')
      //     return false
      //   }
      // })
    }
  }
}
</script>

<style scoped>
  .manage-dialog-title {
    border-bottom: 1px solid #ddd;
    height: 30px;
  }
</style>
